<template>
    <div id="da">
        <div>
            <input type="button" @click="select_one()" value="请点击">
            <ul>
              <li v-for="i in catelist" :key="i.name"><a  @click="select_two(i.id)">{{i.name}}</a></li>
            </ul> 
        </div>
        
    </div>
</template>
<script>
import {select_da_one,select_datwo_one}  from './axios_api/api.js'
export default {   
    name:"da",
    data(){
        return{
          catelist:"",
        }
    },
    methods:{
        select_one(){
            select_da_one()
            .then(res=>{
                console.log(res)
                if(res.code==200){
                  this.catelist = res.data
                }
            })
        },
        select_two(id){
            console.log(id)
            var data={"p_id":id}
            select_datwo_one(data)
            .then(res=>{
            console.log(res)
            this.catelist=res.data
            })
    }
 }
}
</script>
<style>

</style>